package sonnet.demo.server;

import javax.jws.WebMethod;

public class NameResolver implements INameResolver {

	@WebMethod
	public String[] getNames(Integer prefixId) {
		String[] names = new String[3];
		for (int i = 0; i < names.length; i ++) {
			names[i] = prefixId.intValue() + "." + randomString();
		}
		return names;
	}

	private String randomString() {
		int length = (int) (Math.random() * 10 + 1);
		StringBuffer sb = new StringBuffer();
		for (int i = 0; i < length; i ++) {
			sb.append((char) (Math.random() * 30 + 80));
		}
		System.out.print(sb.toString());
		return sb.toString();
	}
}